package logic

import (
	"context"

	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/domain"
	"github.com/zeromicro/go-zero/tools/goctl/example/api/internal/svc"
)

type User interface {
	// 用户根据名和密码登入
	Login(ctx context.Context, req *domain.LoginReq) (resp *domain.LoginResp, err error)
	// 根据用户信息注册账号
	Register(ctx context.Context, req *domain.User) (err error)
	Info(ctx context.Context, req *domain.IdReq) (resp *domain.User, err error)
	Create(ctx context.Context, req *domain.User) (err error)
	Edit(ctx context.Context, req *domain.User) (err error)
	Delete(ctx context.Context, req *domain.IdReq) (err error)
	List(ctx context.Context, req *domain.UserListReq) (resp *domain.UserListResp, err error)
	UpPassword(ctx context.Context, req *domain.UpPasswordReq) (err error)
}

type user struct {
	svcCtx *svc.ServiceContext
}

func NewUser(svcCtx *svc.ServiceContext) User {
	return &user{
		svcCtx: svcCtx,
	}
}

// 用户根据名和密码登入
func (l *user) Login(ctx context.Context, req *domain.LoginReq) (resp *domain.LoginResp, err error) {
	return
}

// 根据用户信息注册账号
func (l *user) Register(ctx context.Context, req *domain.User) (err error) {
	return
}

func (l *user) Info(ctx context.Context, req *domain.IdReq) (resp *domain.User, err error) {
	return
}

func (l *user) Create(ctx context.Context, req *domain.User) (err error) {
	return
}

func (l *user) Edit(ctx context.Context, req *domain.User) (err error) {
	return
}

func (l *user) Delete(ctx context.Context, req *domain.IdReq) (err error) {
	return
}

func (l *user) List(ctx context.Context, req *domain.UserListReq) (resp *domain.UserListResp, err error) {
	return
}

func (l *user) UpPassword(ctx context.Context, req *domain.UpPasswordReq) (err error) {
	return
}
